POST contour import
curl --request POST \
--url https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-SIMA-SYSTEM-ID: <api-key>' \
--form files=@example-file \
--form 'existing_names=[]'import requests
url = "https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour/import"
files = { "files": ("example-file", open("example-file", "rb")) }
payload = { "existing_names": "[]" }
headers = {
"Authorization": "Bearer <token>",
"X-SIMA-SYSTEM-ID": "<api-key>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
form.append('existing_names', '[]');
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'X-SIMA-SYSTEM-ID': '<api-key>'}
};
options.body = form;
fetch('https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"existing_names\"\r\n\r\n[]\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data",
"X-SIMA-SYSTEM-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"fractions": [
{
"key": "postman-1",
"id": null,
"name": "Fracción 1",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-64,
-31
],
[
-63.99,
-31
],
[
-63.99,
-30.99
],
[
-64,
-30.99
],
[
-64,
-31
]
]
]
},
"area_ha": 12.45,
"holes_count": 0,
"invalid": false,
"invalid_reason": null
}
],
"imported_count": 1,
"imported_area_ha": 12.45,
"unreadable_files": [],
"invalid_keys": []
}Version 3 > Establishment Contours
POST contour import
Parsea KML/KMZ y no persiste. Campo multipart: files. Requiere EDIT.
POST
/
api
/
v3
/
third_party
/
establishments
/
{new_establishment}
/
contour
/
import
POST contour import
curl --request POST \
--url https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-SIMA-SYSTEM-ID: <api-key>' \
--form files=@example-file \
--form 'existing_names=[]'import requests
url = "https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour/import"
files = { "files": ("example-file", open("example-file", "rb")) }
payload = { "existing_names": "[]" }
headers = {
"Authorization": "Bearer <token>",
"X-SIMA-SYSTEM-ID": "<api-key>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
form.append('existing_names', '[]');
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'X-SIMA-SYSTEM-ID': '<api-key>'}
};
options.body = form;
fetch('https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.qa.sima.ag/api/v3/third_party/establishments/{new_establishment}/contour/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"existing_names\"\r\n\r\n[]\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data",
"X-SIMA-SYSTEM-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"fractions": [
{
"key": "postman-1",
"id": null,
"name": "Fracción 1",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-64,
-31
],
[
-63.99,
-31
],
[
-63.99,
-30.99
],
[
-64,
-30.99
],
[
-64,
-31
]
]
]
},
"area_ha": 12.45,
"holes_count": 0,
"invalid": false,
"invalid_reason": null
}
],
"imported_count": 1,
"imported_area_ha": 12.45,
"unreadable_files": [],
"invalid_keys": []
}Authorizations
access_token obtenido via POST /api/v2/login
Identificador del sistema integrador (8 para Third-Party API)
Path Parameters
Body
multipart/form-data
Response
200 - application/json
OK
The response is of type object.

